package data;

import java.util.ArrayList;

public class Bird implements Comparable{
	private String name ; 
	private String color; 
	private int weight ;
	private int height;
	
	public Bird(String name, String color, int weight, int height) {
		super();
		this.name = name;
		this.color = color;
		this.weight = weight;
		this.height = height;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	@Override
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		
		if(!(o instanceof Bird))
			throw new ClassCastException("Invalid Object");
		
		Bird otherBird = (Bird)o;

		if(this.getName().compareToIgnoreCase(otherBird.getName())>0)
				return 1 ; 
		else if(this.getName().compareToIgnoreCase(otherBird.getName())<0)
			return -1 ; 
		else return 0 ; 

	}
}
